package edu.isistan.matching.structures.elements;

import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;
import java.util.Map;

public class WSDLDefinitions extends WSDLElement {

	List<OperationElement> operationsList = new ArrayList<OperationElement>();

	List<TypeElement> typesList = new ArrayList<TypeElement>();
	// Podria agregarse portTypes como elemento, y que cada uno de estos tenga
	// las operaciones....

	String ubicacionFile = "";

	Map<String, String> nameSpaces = null;

	String targetNamespace = "";
	
	List<BindingElement> bindingList = new ArrayList<BindingElement>();

	List<ServiceElement> serviceList = new ArrayList<ServiceElement>();
	
	public WSDLDefinitions(String nombre) {
		super(nombre);
	}

	public List<OperationElement> getOperationsList() {
		return operationsList;
	}

	public void setOperationsList(List<OperationElement> operationsList) {
		this.operationsList = operationsList;
		// TODO Mariano 19:09 13-Feb Verificar si ya no se habia agregado el
		// seteo del parent en otro lado
		for (Iterator<OperationElement> it = operationsList.iterator(); it.hasNext();) {
			OperationElement operation = it.next();
			operation.setParentElement(this);
		}
	}

	public List<TypeElement> getTypesList() {
		return typesList;
	}

	public void setTypesList(List<TypeElement> typesList) {
		this.typesList = typesList;
	}

	public String getUbicacionFile() {
		return ubicacionFile;
	}

	public void setUbicacionFile(String ubicacionFile) {
		this.ubicacionFile = ubicacionFile;
	}

	public String toString() {
		return getName() + " types:[" + getTypesList() + "], operations:[" + getOperationsList() + "]";
	}

	public Map<String, String> getNameSpaces() {
		return nameSpaces;
	}

	public void setNameSpaces(Map nameSpaces) {
		this.nameSpaces = nameSpaces;
	}

	public String getTargetNamespace() {
		return targetNamespace;
	}

	public void setTargetNamespace(String targetNamespace) {
		this.targetNamespace = targetNamespace;
	}

	public List<BindingElement> getBindingList() {
		return bindingList;
	}

	public void setBindingList(List<BindingElement> bindingList) {
		this.bindingList = bindingList;
	}

	public List<ServiceElement> getServiceList() {
		return serviceList;
	}

	public void setServiceList(List<ServiceElement> serviceList) {
		this.serviceList = serviceList;
	}

}